from flask_sqlalchemy import SQLAlchemy
from flask import Flask
from flask_migrate import Migrate
import os
from flask_mail import Mail
import redis

app = Flask(__name__, template_folder=os.getcwd() + '/web/templates', static_folder='static')

# 绑定配置文件
app.config.from_pyfile('config/base_settings.py')

# 邮箱
mail = Mail(app)
db = SQLAlchemy(app)
migrate = Migrate(app, db)

# redis连接池

pool = redis.ConnectionPool(host='127.0.0.1', port=6379, db=3)
red = redis.Redis(connection_pool=pool)
